package com.junxonline.instant.dao.entity.model.device;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.ToStringSerializer;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.Date;

/**
 * 终端信息表实体类
 *
 * @author JunX
 * @date 2021-09-27
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName(value = "th_terminal")
public class Terminal implements Serializable {

    /**
     * ID
     */
    @TableId(type = IdType.INPUT)
    @JSONField(serializeUsing = ToStringSerializer.class)
    private Long id;

    /**
     * 类型
     */
    @TableField(value = "type")
    @JSONField(serializeUsing = ToStringSerializer.class)
    private Integer type;

    /**
     * 名称
     */
    @TableField(value = "name")
    private String name;

    /**
     * 编号
     */
    @TableField(value = "code")
    private String code;

    /**
     * 硬件编号
     */
    @TableField(value = "hardware_code")
    private String hardwareCode;

    /**
     * 分辨率
     */
    @TableField(value = "resolution")
    private String resolution;

    /**
     * 软件版本
     */
    @TableField(value = "software_version")
    private String softwareVersion;

    /**
     * 操作系统
     */
    @TableField(value = "os")
    private String os;

    /**
     * 磁盘空间
     */
    @TableField(value = "disk_space")
    private String diskSpace;

    /**
     * 内网IP
     */
    @TableField(value = "intranet_ip")
    private String intranetIp;

    /**
     * 外网IP
     */
    @TableField(value = "internet_ip")
    private String internetIp;

    /**
     * 服务器地址
     */
    @TableField(value = "server_address")
    private String serverAddress;

    /**
     * 心跳时间
     */
    @TableField(value = "heart_beat_time")
    private Date heartBeatTime;

    /**
     * 状态
     */
    @TableField(value = "status")
    @JSONField(serializeUsing = ToStringSerializer.class)
    private Integer status;

    /**
     * 组织机构ID
     */
    @TableField(value = "organization_id")
    private Long organizationId;

    /**
     * 终端分组ID
     */
    @TableField(value = "group_id")
    @JSONField(serializeUsing = ToStringSerializer.class)
    private Long groupId;

    /**
     * 所属城市ID
     */
    @TableField(value = "city_id")
    @JSONField(serializeUsing = ToStringSerializer.class)
    private Long cityId;

    /**
     * 乐观锁
     */
    @Version
    private Integer version;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    protected Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    protected Date updateTime;

    /**
     * 更新人
     */
    @TableField(value = "update_id", fill = FieldFill.INSERT_UPDATE)
    @JSONField(serializeUsing = ToStringSerializer.class)
    protected Long updateId;

    /**
     * 所属机构
     */
    @TableField(exist = false)
    private String organizationName;

    /**
     * 所属分组
     */
    @TableField(exist = false)
    private String groupName;

    /**
     * 所属城市
     */
    @TableField(exist = false)
    private String cityName;

}
